<!doctype html>
<html class="default no-js">
<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<title>Geofence | Cordova Background Geolocation</title>
	<meta name="description" content="">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<link rel="stylesheet" href="../assets/css/main.css">
	<link rel="stylesheet" href="../assets/css/monokai-sublime.css">
</head>
<body>
<header>
	<div class="tsd-page-toolbar">
		<div class="container">
			<div class="table-wrap">
				<div class="table-cell" id="tsd-search" data-index="../assets/js/search.js" data-base="..">
					<div class="field">
						<label for="tsd-search-field" class="tsd-widget search no-caption">Search</label>
						<input id="tsd-search-field" type="text" />
					</div>
					<ul class="results">
						<li class="state loading">Preparing search index...</li>
						<li class="state failure">The search index is not available</li>
					</ul>
					<a href="../globals.html" class="title">[API Docs] Cordova Background Geolocation</a>&nbsp;<span class="tsd-flag ts-flagOptional ts-flagVersion">v 2.14.2</span>
				</div>
				<div class="" id="tsd-widgets">
					<a class="github" href="https://github.com/transistorsoft/cordova-background-geolocation-lt">Github</a>
					<a class="logo" href="https://www.transistorsoft.com"><img src="../assets/images/logo-black-150.png" /></a>
				</div>
			</div>
		</div>
	</div>
	<div class="tsd-page-title">
		<div class="container">
			<ul class="tsd-breadcrumb">
				<li>
					<a href="../globals.html">Globals</a>
				</li>
				<li>
					<a href="../modules/_cordova_background_geolocation_lt_.html">&quot;cordova-background-geolocation-lt&quot;</a>
				</li>
				<li>
					<a href="_cordova_background_geolocation_lt_.geofence.html">Geofence</a>
				</li>
			</ul>
			<h1>Interface Geofence</h1>
		</div>
	</div>
</header>
<div class="container container-main">
	<div class="row">
		<div class="col-9 col-content">
			<section class="tsd-panel tsd-comment">
				<div class="tsd-comment tsd-typography">
					<div class="lead">
						<p>The Background Geolocation SDK implements the native iOS and Android Geofencing APIs.</p>
					</div>
					<p><strong>ℹ️ Note:</strong></p>
					<ul>
						<li>Native iOS &amp; Android API support only <em>circular</em> geofences.</li>
						<li>The minimum reliable <a href="_cordova_background_geolocation_lt_.geofence.html#radius">radius</a> is <code>200</code> meters.</li>
						<li>Geofence monitoring <em>requires</em> the user authorize <a href="_cordova_background_geolocation_lt_.config.html#locationauthorizationrequest">locationAuthorizationRequest</a> <strong><code>Always</code></strong> &mdash; <strong><code>When in Use</code></strong> will <strong>not</strong> work.</li>
					</ul>
					<h2 id="adding-geofences">Adding Geofences</h2>
					<p>Adding a single geofence with <a href="../classes/_cordova_background_geolocation_lt_.backgroundgeolocation.html#addgeofence">addGeofence</a>.</p>
					<dl class="tsd-comment-tags">
						<dt class="tsd-comment-tag-example">example</dt>
						<dd><pre><code class="language-typescript">BackgroundGeolocation.addGeofence({
  identifier: <span class="hljs-string">"Home"</span>,
  radius: <span class="hljs-number">200</span>,
  latitude: <span class="hljs-number">45.51921926</span>,
  longitude: <span class="hljs-number">-73.61678581</span>,
  notifyOnEntry: <span class="hljs-literal">true</span>,
  notifyOnExit: <span class="hljs-literal">true</span>,
  extras: {
    route_id: <span class="hljs-number">1234</span>
  }
}).then(<span class="hljs-function">(<span class="hljs-params">success</span>) =&gt;</span> {
  <span class="hljs-built_in">console</span>.log(<span class="hljs-string">'[addGeofence] success'</span>);
}).catchError(<span class="hljs-function">(<span class="hljs-params">error</span>) =&gt;</span> {
  <span class="hljs-built_in">console</span>.log(<span class="hljs-string">'[addGeofence] FAILURE: '</span>, error);
});</code></pre>
							<p>Adding multiple geofences with <a href="../classes/_cordova_background_geolocation_lt_.backgroundgeolocation.html#addgeofences">addGeofences</a>.</p>
						</dd>
						<dt class="tsd-comment-tag-example">example</dt>
						<dd><pre><code class="language-typescript">BackgroundGeolocation.addGeofences([{
  identifier: <span class="hljs-string">"Home"</span>,
  radius: <span class="hljs-number">200</span>,
  latitude: <span class="hljs-number">45.51921926</span>,
  longitude: <span class="hljs-number">-73.61678581</span>,
  notifyOnEntry: <span class="hljs-literal">true</span>,
}, {
  identifier: <span class="hljs-string">"Work"</span>,
  radius: <span class="hljs-number">200</span>,
  latitude: <span class="hljs-number">45.61921927</span>,
  longitude: <span class="hljs-number">-73.71678582</span>,
  notifyOnEntry: <span class="hljs-literal">true</span>
}]).then(<span class="hljs-function">(<span class="hljs-params">success</span>) =&gt;</span> {
  <span class="hljs-built_in">console</span>.log(<span class="hljs-string">'[addGeofences] success'</span>);
}).catchError(<span class="hljs-function">(<span class="hljs-params">error</span>) =&gt;</span> {
  <span class="hljs-built_in">console</span>.log(<span class="hljs-string">'[addGeofences] FAILURE: '</span>, error);
});</code></pre>
							<p><strong>ℹ️ Note:</strong> Adding a geofence having an <a href="_cordova_background_geolocation_lt_.geofence.html#identifier">identifier</a> which already exists within the SDK geofence database will cause the previous record to be destroyed and the new one inserted.</p>
							<hr>
							<h2 id="listening-for-geofence-events">Listening for Geofence Events</h2>
							<p>Listen to geofence events with <a href="../classes/_cordova_background_geolocation_lt_.backgroundgeolocation.html#ongeofence">BackgroundGeolocation.onGeofence</a>.</p>
						</dd>
						<dt class="tsd-comment-tag-example">example</dt>
						<dd><pre><code class="language-typescript"><span class="hljs-comment">// Listen for geofence events.</span>
BackgroundGeolocation.onGeofence(<span class="hljs-function"><span class="hljs-params">geofence</span> =&gt;</span> {
  <span class="hljs-built_in">console</span>.log(<span class="hljs-string">'[geofence] '</span>, geofence.identifier, geofence.action);
});</code></pre>
							<hr>
							<h2 id="infinite-geofencing">Infinite Geofencing</h2>
							<p>The Background Geolocation SDK contains unique and powerful geofencing features that allow you to monitor any number of circular geofences you wish (thousands even), in spite of limits imposed by the native platform APIs (<strong>20 for iOS; 100 for Android</strong>).</p>
							<p>The SDK achieves this by storing your geofences in its database, using a <a href="https://en.wikipedia.org/wiki/Spatial_query">geospatial query</a> to determine those geofences in proximity (<a href="_cordova_background_geolocation_lt_.config.html#geofenceproximityradius">geofenceProximityRadius</a>), activating only those geofences closest to the device&#39;s current location (according the limit imposed by the corresponding platform).</p>
							<ul>
								<li>When the device is determined to be moving, the plugin periodically queries for geofences within the <a href="_cordova_background_geolocation_lt_.config.html#geofenceproximityradius">geofenceProximityRadius</a> (eg. every minute) using the latest recorded location.  This geospatial query is <strong>very fast</strong>, even with tens-of-thousands geofences in the database.</li>
								<li>The SDK <strong>enforces</strong> a <em>minimum</em> <a href="_cordova_background_geolocation_lt_.config.html#geofenceproximityradius">geofenceProximityRadius</a> of <code>1000</code> meters.</li>
								<li>In the following image, the <em>green</em> geofences within <a href="_cordova_background_geolocation_lt_.config.html#geofenceproximityradius">geofenceProximityRadius</a> are <em>actively</em> monitored.  The <em>grey</em> geofences outside <a href="_cordova_background_geolocation_lt_.config.html#geofenceproximityradius">geofenceProximityRadius</a> still exist within the SDK&#39;s database but are <em>not</em> actively being monitored.</li>
							</ul>
							<p><img src="https://dl.dropboxusercontent.com/s/7sggka4vcbrokwt/geofenceProximityRadius_iphone6_spacegrey_portrait.png?dl=1" alt=""></p>
							<hr>
							<h2 id="listening-for-changes-in-the-actively-monitored-set-of-geofences-">Listening for changes in the actively-monitored set-of-geofences.</h2>
							<p>As the SDK periodically queries for geofences within the <a href="_cordova_background_geolocation_lt_.config.html#geofenceproximityradius">geofenceProximityRadius</a>, you can listen for changes in the actively-monitored geofences using the event <a href="../classes/_cordova_background_geolocation_lt_.backgroundgeolocation.html#ongeofenceschange">onGeofencesChange</a>.  This event will let you know those geofences which have <em>begun</em> to be <em>actively monitored</em> (<a href="_cordova_background_geolocation_lt_.geofenceschangeevent.html#on">GeofencesChangeEvent.on</a>) in addition to those which just <em>ceased</em> to be actively monitored (<a href="_cordova_background_geolocation_lt_.geofenceschangeevent.html#off">GeofencesChangeEvent.off</a>).</p>
						</dd>
						<dt class="tsd-comment-tag-example">example</dt>
						<dd><pre><code class="language-javascript">BackgroundGeolocation.onGeofencesChange(<span class="hljs-function">(<span class="hljs-params">event</span>) =&gt;</span> {
  <span class="hljs-keyword">let</span> on = event.on;     <span class="hljs-comment">//&lt;-- new geofences activiated.</span>
  <span class="hljs-keyword">let</span> off = event.off; <span class="hljs-comment">//&lt;-- geofences that were just de-activated.</span>

  <span class="hljs-comment">// Create map circles</span>
  on.forEach(<span class="hljs-function">(<span class="hljs-params">geofence</span>) =&gt;</span> {
    createGeofenceMarker(geofence)
  });

  <span class="hljs-comment">// Remove map circles</span>
  off.forEach(<span class="hljs-function">(<span class="hljs-params">identifier</span>) =&gt;</span> {
    removeGeofenceMarker(identifier);
  }
});</code></pre>
							<h3 id="-note-">⚠️ Note:</h3>
							<ul>
								<li>When <strong>all</strong> geofences have been removed, the <a href="_cordova_background_geolocation_lt_.geofenceschangeevent.html">GeofencesChangeEvent</a> will provide empty lists for both <a href="_cordova_background_geolocation_lt_.geofenceschangeevent.html#on">GeofencesChangeEvent.on</a> &amp; <a href="_cordova_background_geolocation_lt_.geofenceschangeevent.html#off">GeofencesChangeEvent.off</a>.</li>
							</ul>
							<hr>
							<h2 id="removing-geofences">Removing Geofences</h2>
							<p>Once a geofence has been inserted into the SDK&#39;s database using <a href="../classes/_cordova_background_geolocation_lt_.backgroundgeolocation.html#addgeofence">addGeofence</a> or <a href="../classes/_cordova_background_geolocation_lt_.backgroundgeolocation.html#addgeofences">addGeofences</a>, they will be monitored <em>forever</em>.  If you&#39;ve configured <a href="_cordova_background_geolocation_lt_.config.html#stoponterminate">stopOnTerminate</a> <strong><code>false</code></strong> and <a href="_cordova_background_geolocation_lt_.config.html#startonboot">startOnBoot</a> <strong><code>true</code></strong>, geofences will continue to be monitored even if the application is terminated or device rebooted.
							To cease monitoring a geofence or <em>geofences</em>, you must <em>remove</em> them from the SDK&#39;s database.</p>
							<ul>
								<li>Removing a single geofence by <a href="_cordova_background_geolocation_lt_.geofence.html#identifier">identifier</a> with <a href="../classes/_cordova_background_geolocation_lt_.backgroundgeolocation.html#removegeofence">removeGeofence</a>:</li>
							</ul>
						</dd>
						<dt class="tsd-comment-tag-example">example</dt>
						<dd><pre><code class="language-typescript">BackgroundGeolocation.removeGeofence(<span class="hljs-string">'HOME'</span>).then(<span class="hljs-function"><span class="hljs-params">success</span> =&gt;</span> {
  <span class="hljs-built_in">console</span>.log(<span class="hljs-string">'[removeGeofence] success'</span>);
})</code></pre>
							<ul>
								<li>Removing <em>all</em> geofences with <a href="../classes/_cordova_background_geolocation_lt_.backgroundgeolocation.html#removegeofences">removeGeofences</a>:</li>
							</ul>
						</dd>
						<dt class="tsd-comment-tag-example">example</dt>
						<dd><pre><code class="language-typescript">BackgroundGeolocation.removeGeofences().then(<span class="hljs-function"><span class="hljs-params">success</span> =&gt;</span> {
  <span class="hljs-built_in">console</span>.log(<span class="hljs-string">'[removeGeofences] all geofences have been destroyed'</span>);
})</code></pre>
							<hr>
							<h2 id="querying-geofences">Querying Geofences</h2>
							<p>Use the method <a href="../classes/_cordova_background_geolocation_lt_.backgroundgeolocation.html#getgeofences">getGeofences</a> to retreive the entire Array of <a href="_cordova_background_geolocation_lt_.geofence.html">Geofence</a> stored in the SDK&#39;s database.</p>
						</dd>
						<dt class="tsd-comment-tag-example">example</dt>
						<dd><pre><code class="language-typescript">BackgroundGeolocation.getGeofences().then(<span class="hljs-function"><span class="hljs-params">geofences</span> =&gt;</span> {
  <span class="hljs-built_in">console</span>.log(<span class="hljs-string">'[getGeofences] '</span>, geofences);
})</code></pre>
							<hr>
							<h2 id="monitoring-only-geofences">Monitoring <em>only</em> geofences</h2>
							<p>The BackgroundGeolocation SDK allows you to optionally monitor <em>only</em> geofences without constant location-tracking.  To engage <em>geofences-only</em> mode, use the method <a href="../classes/_cordova_background_geolocation_lt_.backgroundgeolocation.html#startgeofences">startGeofences</a> instead of <a href="../classes/_cordova_background_geolocation_lt_.backgroundgeolocation.html#start">start</a>.</p>
						</dd>
						<dt class="tsd-comment-tag-example">example</dt>
						<dd><pre><code class="language-typescript">BackgroundGeolocation.onGeofence(<span class="hljs-function"><span class="hljs-params">geofence</span> =&gt;</span> {
  <span class="hljs-built_in">console</span>.log(<span class="hljs-string">'[geofence] '</span>, geofence);
})

BackgroundGeolocation.ready({
  url: <span class="hljs-string">'http://your.server.com/geofences'</span>,
  autoSync: <span class="hljs-literal">true</span>
}, <span class="hljs-function"><span class="hljs-params">state</span> =&gt;</span> {
  <span class="hljs-comment">// engage geofences-only mode:</span>
  BackgroundGeolocation.startGeofences();
})</code></pre>
							<h2 id="toggling-between-tracking-modes-a-href-classes-_cordova_background_geolocation_lt_-backgroundgeolocation-html-start-start-a-and-a-href-classes-_cordova_background_geolocation_lt_-backgroundgeolocation-html-startgeofences-startgeofences-a-">Toggling between tracking-modes <a href="../classes/_cordova_background_geolocation_lt_.backgroundgeolocation.html#start">start</a> and <a href="../classes/_cordova_background_geolocation_lt_.backgroundgeolocation.html#startgeofences">startGeofences</a></h2>
							<p>The SDK can easily be toggled between <a href="_cordova_background_geolocation_lt_.state.html#trackingmode">State.trackingMode</a> simply by executing the corresponding <a href="../classes/_cordova_background_geolocation_lt_.backgroundgeolocation.html#start">start</a> or <a href="../classes/_cordova_background_geolocation_lt_.backgroundgeolocation.html#startgeofences">startGeofences</a> methods.</p>
						</dd>
						<dt class="tsd-comment-tag-example">example</dt>
						<dd><pre><code class="language-typescript"><span class="hljs-comment">// Listen to geofence events</span>
BackgroundGeolocation.onGeofence(<span class="hljs-function"><span class="hljs-params">geofence</span> =&gt;</span> {
  <span class="hljs-built_in">console</span>.log(<span class="hljs-string">'[geofence] '</span>, geofence);
  <span class="hljs-keyword">if</span> (geofence.identifier == <span class="hljs-string">'DANGER_ZONE'</span>) {
    <span class="hljs-keyword">if</span> (geofence.action == <span class="hljs-string">'ENTER'</span>) {
      <span class="hljs-comment">// Entering the danger-zone, we want to aggressively track location.</span>
      BackgroundGeolocation.start();
    } <span class="hljs-keyword">else</span> <span class="hljs-keyword">if</span> (geofence.action == <span class="hljs-string">'EXIT'</span>) {
      <span class="hljs-comment">// Exiting the danger-zone, we resume geofences-only tracking.</span>
      BackgroundGeolocation.startGeofences();
    }
  }
})

<span class="hljs-comment">// Add a geofence.</span>
BackgroundGeolocation.addGeofence({
  identifier: <span class="hljs-string">"DANGER_ZONE"</span>,
  radius: <span class="hljs-number">1000</span>,
  latitude: <span class="hljs-number">45.51921926</span>,
  longitude: <span class="hljs-number">-73.61678581</span>,
  notifyOnEntry: <span class="hljs-literal">true</span>,
  notifyOnExit: <span class="hljs-literal">true</span>,
})

<span class="hljs-comment">// Ready the plugin.</span>
BackgroundGeolocation.ready({
  desiredAccuracy: BackgroundGeolocation.DESIRED_ACCURACY_HIGH,
  distanceFilter: <span class="hljs-number">10</span>,
  url: <span class="hljs-string">'http://your.server.com/locations'</span>,
  autoSync: <span class="hljs-literal">true</span>
}, <span class="hljs-function"><span class="hljs-params">state</span> =&gt;</span> {
  BackgroundGeolocation.startGeofences();
})</code></pre>
						</dd>
					</dl>
				</div>
			</section>
			<section class="tsd-panel tsd-hierarchy">
				<h3>Hierarchy</h3>
				<ul class="tsd-hierarchy">
					<li>
						<span class="target">Geofence</span>
					</li>
				</ul>
			</section>
			<section class="tsd-panel-group tsd-index-group">
				<h2>Index</h2>
				<section class="tsd-panel tsd-index-panel">
					<div class="tsd-index-content">
						<section class="tsd-index-section tsd-is-not-exported">
							<h3>Properties</h3>
							<ul class="tsd-index-list">
								<li class="tsd-kind-property tsd-parent-kind-interface tsd-is-not-exported"><a href="_cordova_background_geolocation_lt_.geofence.html#extras" class="tsd-kind-icon">extras</a></li>
								<li class="tsd-kind-property tsd-parent-kind-interface tsd-is-not-exported"><a href="_cordova_background_geolocation_lt_.geofence.html#identifier" class="tsd-kind-icon">identifier</a></li>
								<li class="tsd-kind-property tsd-parent-kind-interface tsd-is-not-exported"><a href="_cordova_background_geolocation_lt_.geofence.html#latitude" class="tsd-kind-icon">latitude</a></li>
								<li class="tsd-kind-property tsd-parent-kind-interface tsd-is-not-exported"><a href="_cordova_background_geolocation_lt_.geofence.html#loiteringdelay" class="tsd-kind-icon">loitering<wbr>Delay</a></li>
								<li class="tsd-kind-property tsd-parent-kind-interface tsd-is-not-exported"><a href="_cordova_background_geolocation_lt_.geofence.html#longitude" class="tsd-kind-icon">longitude</a></li>
								<li class="tsd-kind-property tsd-parent-kind-interface tsd-is-not-exported"><a href="_cordova_background_geolocation_lt_.geofence.html#notifyondwell" class="tsd-kind-icon">notify<wbr>OnDwell</a></li>
								<li class="tsd-kind-property tsd-parent-kind-interface tsd-is-not-exported"><a href="_cordova_background_geolocation_lt_.geofence.html#notifyonentry" class="tsd-kind-icon">notify<wbr>OnEntry</a></li>
								<li class="tsd-kind-property tsd-parent-kind-interface tsd-is-not-exported"><a href="_cordova_background_geolocation_lt_.geofence.html#notifyonexit" class="tsd-kind-icon">notify<wbr>OnExit</a></li>
								<li class="tsd-kind-property tsd-parent-kind-interface tsd-is-not-exported"><a href="_cordova_background_geolocation_lt_.geofence.html#radius" class="tsd-kind-icon">radius</a></li>
							</ul>
						</section>
					</div>
				</section>
			</section>
			<section class="tsd-panel-group tsd-member-group tsd-is-not-exported">
				<h2>Properties</h2>
				<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-not-exported">
					<a name="extras" class="tsd-anchor"></a>
					<h3><span class="tsd-flag ts-flagOptional">Optional</span> extras</h3>
					<div class="tsd-signature tsd-kind-icon">extras<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Object</span></div>
					<aside class="tsd-sources">
					</aside>
					<div class="tsd-comment tsd-typography">
						<div class="lead">
							<p>Arbitrary key-values appended to the geofence event and posted to your configured <a href="_cordova_background_geolocation_lt_.config.html#url">Config.url</a>.</p>
						</div>
					</div>
				</section>
				<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-not-exported">
					<a name="identifier" class="tsd-anchor"></a>
					<h3>identifier</h3>
					<div class="tsd-signature tsd-kind-icon">identifier<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div>
					<aside class="tsd-sources">
					</aside>
					<div class="tsd-comment tsd-typography">
						<div class="lead">
							<p>Unique geofence identifier.</p>
						</div>
					</div>
				</section>
				<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-not-exported">
					<a name="latitude" class="tsd-anchor"></a>
					<h3>latitude</h3>
					<div class="tsd-signature tsd-kind-icon">latitude<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div>
					<aside class="tsd-sources">
					</aside>
					<div class="tsd-comment tsd-typography">
						<div class="lead">
							<p>Latitude of geofence center</p>
						</div>
					</div>
				</section>
				<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-not-exported">
					<a name="loiteringdelay" class="tsd-anchor"></a>
					<h3><span class="tsd-flag ts-flagOptional">Optional</span> loitering<wbr>Delay</h3>
					<div class="tsd-signature tsd-kind-icon">loitering<wbr>Delay<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div>
					<aside class="tsd-sources">
					</aside>
					<div class="tsd-comment tsd-typography">
						<div class="lead">
							<p>Minimum time in <em>milliseconds</em> the device must &quot;loiter&quot; within this geofence before <a href="_cordova_background_geolocation_lt_.geofence.html#notifyondwell">notifyOnDwell</a> event fires.</p>
						</div>
					</div>
				</section>
				<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-not-exported">
					<a name="longitude" class="tsd-anchor"></a>
					<h3>longitude</h3>
					<div class="tsd-signature tsd-kind-icon">longitude<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div>
					<aside class="tsd-sources">
					</aside>
					<div class="tsd-comment tsd-typography">
						<div class="lead">
							<p>Longitude of geofence center.</p>
						</div>
					</div>
				</section>
				<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-not-exported">
					<a name="notifyondwell" class="tsd-anchor"></a>
					<h3><span class="tsd-flag ts-flagOptional">Optional</span> notify<wbr>OnDwell</h3>
					<div class="tsd-signature tsd-kind-icon">notify<wbr>OnDwell<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div>
					<aside class="tsd-sources">
					</aside>
					<div class="tsd-comment tsd-typography">
						<div class="lead">
							<p>Set <code>true</code> to fire event when device &quot;loiters&quot; within this geofence for <a href="_cordova_background_geolocation_lt_.geofence.html#loiteringdelay">loiteringDelay</a> milliseconds.</p>
						</div>
					</div>
				</section>
				<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-not-exported">
					<a name="notifyonentry" class="tsd-anchor"></a>
					<h3><span class="tsd-flag ts-flagOptional">Optional</span> notify<wbr>OnEntry</h3>
					<div class="tsd-signature tsd-kind-icon">notify<wbr>OnEntry<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div>
					<aside class="tsd-sources">
					</aside>
					<div class="tsd-comment tsd-typography">
						<div class="lead">
							<p>Set <code>true</code> to fire event when device <em>enters</em> this geofence.</p>
						</div>
						<p><strong>ℹ️ See also:</strong></p>
						<ul>
							<li><a href="_cordova_background_geolocation_lt_.config.html#geofenceinitialtriggerentry">Config.geofenceInitialTriggerEntry</a></li>
						</ul>
					</div>
				</section>
				<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-not-exported">
					<a name="notifyonexit" class="tsd-anchor"></a>
					<h3><span class="tsd-flag ts-flagOptional">Optional</span> notify<wbr>OnExit</h3>
					<div class="tsd-signature tsd-kind-icon">notify<wbr>OnExit<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div>
					<aside class="tsd-sources">
					</aside>
					<div class="tsd-comment tsd-typography">
						<div class="lead">
							<p>Set <code>true</code> to fire event when device <em>exits</em> this geofence.</p>
						</div>
					</div>
				</section>
				<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-not-exported">
					<a name="radius" class="tsd-anchor"></a>
					<h3>radius</h3>
					<div class="tsd-signature tsd-kind-icon">radius<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div>
					<aside class="tsd-sources">
					</aside>
					<div class="tsd-comment tsd-typography">
						<div class="lead">
							<p>Radius of the circular geofence.</p>
						</div>
						<p>⚠️ The minimum reliable <code>radius</code> is <strong><code>200</code></strong> meters.  Anything less will likely not cause a geofence to trigger.  This is documented by Apple <a href="https://developer.apple.com/library/archive/documentation/UserExperience/Conceptual/LocationAwarenessPG/RegionMonitoring/RegionMonitoring.html">here</a>:</p>
						<blockquote>
							<p><em>&quot;The specific threshold distances are determined by the hardware and the location technologies that are currently available. For example, if Wi-Fi is disabled, region monitoring is significantly less accurate. However, for testing purposes, <strong>you can assume that the minimum distance is approximately 200 meters</strong></em>&quot;.</p>
						</blockquote>
					</div>
				</section>
			</section>
		</div>
		<div class="col-3 col-menu menu-sticky-wrap menu-highlight">
			<nav class="tsd-navigation primary menu-sticky">
				<ul class="before-current">
					<li class=" tsd-kind-class tsd-parent-kind-module">
						<a href="../classes/_cordova_background_geolocation_lt_.backgroundgeolocation.html" class="tsd-kind-icon">Background<wbr>Geolocation</a>
					</li>
					<li class=" tsd-kind-interface tsd-parent-kind-module tsd-is-not-exported">
						<a href="_cordova_background_geolocation_lt_.battery.html" class="tsd-kind-icon">Battery</a>
					</li>
					<li class=" tsd-kind-interface tsd-parent-kind-module tsd-is-not-exported">
						<a href="_cordova_background_geolocation_lt_.config.html" class="tsd-kind-icon">Config</a>
					</li>
					<li class=" tsd-kind-interface tsd-parent-kind-module tsd-is-not-exported">
						<a href="_cordova_background_geolocation_lt_.connectivitychangeevent.html" class="tsd-kind-icon">Connectivity<wbr>Change<wbr>Event</a>
					</li>
					<li class=" tsd-kind-interface tsd-parent-kind-module tsd-is-not-exported">
						<a href="_cordova_background_geolocation_lt_.coords.html" class="tsd-kind-icon">Coords</a>
					</li>
					<li class=" tsd-kind-interface tsd-parent-kind-module tsd-is-not-exported">
						<a href="_cordova_background_geolocation_lt_.currentpositionrequest.html" class="tsd-kind-icon">Current<wbr>Position<wbr>Request</a>
					</li>
				</ul>
				<ul class="current">
					<li class="current tsd-kind-interface tsd-parent-kind-module tsd-is-not-exported">
						<a href="_cordova_background_geolocation_lt_.geofence.html" class="tsd-kind-icon">Geofence</a>
						<ul>
							<li class=" tsd-kind-property tsd-parent-kind-interface tsd-is-not-exported">
								<a href="_cordova_background_geolocation_lt_.geofence.html#extras" class="tsd-kind-icon">extras</a>
							</li>
							<li class=" tsd-kind-property tsd-parent-kind-interface tsd-is-not-exported">
								<a href="_cordova_background_geolocation_lt_.geofence.html#identifier" class="tsd-kind-icon">identifier</a>
							</li>
							<li class=" tsd-kind-property tsd-parent-kind-interface tsd-is-not-exported">
								<a href="_cordova_background_geolocation_lt_.geofence.html#latitude" class="tsd-kind-icon">latitude</a>
							</li>
							<li class=" tsd-kind-property tsd-parent-kind-interface tsd-is-not-exported">
								<a href="_cordova_background_geolocation_lt_.geofence.html#loiteringdelay" class="tsd-kind-icon">loitering<wbr>Delay</a>
							</li>
							<li class=" tsd-kind-property tsd-parent-kind-interface tsd-is-not-exported">
								<a href="_cordova_background_geolocation_lt_.geofence.html#longitude" class="tsd-kind-icon">longitude</a>
							</li>
							<li class=" tsd-kind-property tsd-parent-kind-interface tsd-is-not-exported">
								<a href="_cordova_background_geolocation_lt_.geofence.html#notifyondwell" class="tsd-kind-icon">notify<wbr>OnDwell</a>
							</li>
							<li class=" tsd-kind-property tsd-parent-kind-interface tsd-is-not-exported">
								<a href="_cordova_background_geolocation_lt_.geofence.html#notifyonentry" class="tsd-kind-icon">notify<wbr>OnEntry</a>
							</li>
							<li class=" tsd-kind-property tsd-parent-kind-interface tsd-is-not-exported">
								<a href="_cordova_background_geolocation_lt_.geofence.html#notifyonexit" class="tsd-kind-icon">notify<wbr>OnExit</a>
							</li>
							<li class=" tsd-kind-property tsd-parent-kind-interface tsd-is-not-exported">
								<a href="_cordova_background_geolocation_lt_.geofence.html#radius" class="tsd-kind-icon">radius</a>
							</li>
						</ul>
					</li>
				</ul>
				<ul class="after-current">
					<li class=" tsd-kind-interface tsd-parent-kind-module tsd-is-not-exported">
						<a href="_cordova_background_geolocation_lt_.geofenceevent.html" class="tsd-kind-icon">Geofence<wbr>Event</a>
					</li>
					<li class=" tsd-kind-interface tsd-parent-kind-module tsd-is-not-exported">
						<a href="_cordova_background_geolocation_lt_.geofenceschangeevent.html" class="tsd-kind-icon">Geofences<wbr>Change<wbr>Event</a>
					</li>
					<li class=" tsd-kind-interface tsd-parent-kind-module tsd-is-not-exported">
						<a href="_cordova_background_geolocation_lt_.heartbeatevent.html" class="tsd-kind-icon">Heartbeat<wbr>Event</a>
					</li>
					<li class=" tsd-kind-interface tsd-parent-kind-module tsd-is-not-exported">
						<a href="_cordova_background_geolocation_lt_.httpevent.html" class="tsd-kind-icon">Http<wbr>Event</a>
					</li>
					<li class=" tsd-kind-interface tsd-parent-kind-module">
						<a href="_cordova_background_geolocation_lt_.location.html" class="tsd-kind-icon">Location</a>
					</li>
					<li class=" tsd-kind-interface tsd-parent-kind-module tsd-is-not-exported">
						<a href="_cordova_background_geolocation_lt_.locationauthorizationalert.html" class="tsd-kind-icon">Location<wbr>Authorization<wbr>Alert</a>
					</li>
					<li class=" tsd-kind-interface tsd-parent-kind-module tsd-is-not-exported">
						<a href="_cordova_background_geolocation_lt_.logger.html" class="tsd-kind-icon">Logger</a>
					</li>
					<li class=" tsd-kind-interface tsd-parent-kind-module tsd-is-not-exported">
						<a href="_cordova_background_geolocation_lt_.motionactivityevent.html" class="tsd-kind-icon">Motion<wbr>Activity<wbr>Event</a>
					</li>
					<li class=" tsd-kind-interface tsd-parent-kind-module tsd-is-not-exported">
						<a href="_cordova_background_geolocation_lt_.motionchangeevent.html" class="tsd-kind-icon">Motion<wbr>Change<wbr>Event</a>
					</li>
					<li class=" tsd-kind-interface tsd-parent-kind-module tsd-is-not-exported">
						<a href="_cordova_background_geolocation_lt_.providerchangeevent.html" class="tsd-kind-icon">Provider<wbr>Change<wbr>Event</a>
					</li>
					<li class=" tsd-kind-interface tsd-parent-kind-module tsd-is-not-exported">
						<a href="_cordova_background_geolocation_lt_.sensors.html" class="tsd-kind-icon">Sensors</a>
					</li>
					<li class=" tsd-kind-interface tsd-parent-kind-module tsd-is-not-exported">
						<a href="_cordova_background_geolocation_lt_.state.html" class="tsd-kind-icon">State</a>
					</li>
					<li class=" tsd-kind-interface tsd-parent-kind-module tsd-is-not-exported">
						<a href="_cordova_background_geolocation_lt_.watchpositionrequest.html" class="tsd-kind-icon">Watch<wbr>Position<wbr>Request</a>
					</li>
					<li class=" tsd-kind-type-alias tsd-parent-kind-module tsd-is-not-exported">
						<a href="../modules/_cordova_background_geolocation_lt_.html#activitytype" class="tsd-kind-icon">Activity<wbr>Type</a>
					</li>
					<li class=" tsd-kind-type-alias tsd-parent-kind-module tsd-is-not-exported">
						<a href="../modules/_cordova_background_geolocation_lt_.html#authorizationstatus" class="tsd-kind-icon">Authorization<wbr>Status</a>
					</li>
					<li class=" tsd-kind-type-alias tsd-parent-kind-module tsd-is-not-exported">
						<a href="../modules/_cordova_background_geolocation_lt_.html#httpmethod" class="tsd-kind-icon">Http<wbr>Method</a>
					</li>
					<li class=" tsd-kind-type-alias tsd-parent-kind-module tsd-is-not-exported">
						<a href="../modules/_cordova_background_geolocation_lt_.html#locationaccuracy" class="tsd-kind-icon">Location<wbr>Accuracy</a>
					</li>
					<li class=" tsd-kind-type-alias tsd-parent-kind-module tsd-is-not-exported">
						<a href="../modules/_cordova_background_geolocation_lt_.html#locationauthorizationrequest" class="tsd-kind-icon">Location<wbr>Authorization<wbr>Request</a>
					</li>
					<li class=" tsd-kind-type-alias tsd-parent-kind-module tsd-is-not-exported">
						<a href="../modules/_cordova_background_geolocation_lt_.html#locationerror" class="tsd-kind-icon">Location<wbr>Error</a>
					</li>
					<li class=" tsd-kind-type-alias tsd-parent-kind-module tsd-is-not-exported">
						<a href="../modules/_cordova_background_geolocation_lt_.html#loglevel" class="tsd-kind-icon">Log<wbr>Level</a>
					</li>
					<li class=" tsd-kind-type-alias tsd-parent-kind-module tsd-is-not-exported">
						<a href="../modules/_cordova_background_geolocation_lt_.html#notificationpriority" class="tsd-kind-icon">Notification<wbr>Priority</a>
					</li>
					<li class=" tsd-kind-type-alias tsd-parent-kind-module tsd-is-not-exported">
						<a href="../modules/_cordova_background_geolocation_lt_.html#trackingmode" class="tsd-kind-icon">Tracking<wbr>Mode</a>
					</li>
				</ul>
			</nav>
		</div>
	</div>
</div>
<footer class="with-border-bottom">
	<div class="container">
		<h2>Legend</h2>
		<div class="tsd-legend-group">
			<ul class="tsd-legend">
				<li class="tsd-kind-module"><span class="tsd-kind-icon">Module</span></li>
				<li class="tsd-kind-object-literal"><span class="tsd-kind-icon">Object literal</span></li>
				<li class="tsd-kind-variable"><span class="tsd-kind-icon">Variable</span></li>
				<li class="tsd-kind-function"><span class="tsd-kind-icon">Function</span></li>
				<li class="tsd-kind-function tsd-has-type-parameter"><span class="tsd-kind-icon">Function with type parameter</span></li>
				<li class="tsd-kind-index-signature"><span class="tsd-kind-icon">Index signature</span></li>
				<li class="tsd-kind-type-alias"><span class="tsd-kind-icon">Type alias</span></li>
				<li class="tsd-kind-type-alias tsd-has-type-parameter"><span class="tsd-kind-icon">Type alias with type parameter</span></li>
			</ul>
			<ul class="tsd-legend">
				<li class="tsd-kind-enum"><span class="tsd-kind-icon">Enumeration</span></li>
				<li class="tsd-kind-enum-member"><span class="tsd-kind-icon">Enumeration member</span></li>
				<li class="tsd-kind-property tsd-parent-kind-enum"><span class="tsd-kind-icon">Property</span></li>
				<li class="tsd-kind-method tsd-parent-kind-enum"><span class="tsd-kind-icon">Method</span></li>
			</ul>
			<ul class="tsd-legend">
				<li class="tsd-kind-interface"><span class="tsd-kind-icon">Interface</span></li>
				<li class="tsd-kind-interface tsd-has-type-parameter"><span class="tsd-kind-icon">Interface with type parameter</span></li>
				<li class="tsd-kind-constructor tsd-parent-kind-interface"><span class="tsd-kind-icon">Constructor</span></li>
				<li class="tsd-kind-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li>
				<li class="tsd-kind-method tsd-parent-kind-interface"><span class="tsd-kind-icon">Method</span></li>
				<li class="tsd-kind-index-signature tsd-parent-kind-interface"><span class="tsd-kind-icon">Index signature</span></li>
			</ul>
			<ul class="tsd-legend">
				<li class="tsd-kind-class"><span class="tsd-kind-icon">Class</span></li>
				<li class="tsd-kind-class tsd-has-type-parameter"><span class="tsd-kind-icon">Class with type parameter</span></li>
				<li class="tsd-kind-constructor tsd-parent-kind-class"><span class="tsd-kind-icon">Constructor</span></li>
				<li class="tsd-kind-property tsd-parent-kind-class"><span class="tsd-kind-icon">Property</span></li>
				<li class="tsd-kind-method tsd-parent-kind-class"><span class="tsd-kind-icon">Method</span></li>
				<li class="tsd-kind-accessor tsd-parent-kind-class"><span class="tsd-kind-icon">Accessor</span></li>
				<li class="tsd-kind-index-signature tsd-parent-kind-class"><span class="tsd-kind-icon">Index signature</span></li>
			</ul>
			<ul class="tsd-legend">
				<li class="tsd-kind-constructor tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited constructor</span></li>
				<li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited property</span></li>
				<li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited method</span></li>
				<li class="tsd-kind-accessor tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited accessor</span></li>
			</ul>
			<ul class="tsd-legend">
				<li class="tsd-kind-property tsd-parent-kind-class tsd-is-protected"><span class="tsd-kind-icon">Protected property</span></li>
				<li class="tsd-kind-method tsd-parent-kind-class tsd-is-protected"><span class="tsd-kind-icon">Protected method</span></li>
				<li class="tsd-kind-accessor tsd-parent-kind-class tsd-is-protected"><span class="tsd-kind-icon">Protected accessor</span></li>
			</ul>
			<ul class="tsd-legend">
				<li class="tsd-kind-property tsd-parent-kind-class tsd-is-private"><span class="tsd-kind-icon">Private property</span></li>
				<li class="tsd-kind-method tsd-parent-kind-class tsd-is-private"><span class="tsd-kind-icon">Private method</span></li>
				<li class="tsd-kind-accessor tsd-parent-kind-class tsd-is-private"><span class="tsd-kind-icon">Private accessor</span></li>
			</ul>
			<ul class="tsd-legend">
				<li class="tsd-kind-property tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static property</span></li>
				<li class="tsd-kind-call-signature tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static method</span></li>
			</ul>
		</div>
	</div>
</footer>
<div class="container tsd-generator">
	<p>Generated using <a href="http://typedoc.org/" target="_blank">TypeDoc</a></p>
</div>
<div class="overlay"></div>
<script src="../assets/js/main.js"></script>
<script>if (location.protocol == 'file:') document.write('<script src="../assets/js/search.js"><' + '/script>');</script>
<script>
        (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
            (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
                m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
        })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

        ga('create', 'UA-102968-14', 'auto');
        ga('send', 'pageview');
    </script>
</body>
</html>